CREATE TABLE [dbo].[TDTBLS_SIST]
(
[CO_SIST] [dbo].[TD_VC_008] NOT NULL,
[CO_TBLS] [dbo].[TD_VC_020] NOT NULL,
[CO_ATRI] [dbo].[TD_VC_020] NOT NULL,
[DE_ATRI] [dbo].[TD_VC_050] NULL,
[TI_DATO] [dbo].[TD_VC_001] NULL,
[NU_LOGI] [dbo].[TD_NU_016_004] NOT NULL CONSTRAINT [DF__TDTBLS_SI__NU_LO__36B12243] DEFAULT ((0)),
[ST_PKEY] [dbo].[TD_VC_001_SINO] NULL,
[DE_OBSE] [dbo].[TD_VC_200] NULL,
[CO_USUA_CREA] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TDTBLS_SI__CO_US__38996AB5] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_CREA] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TDTBLS_SI__FE_US__398D8EEE] DEFAULT (getdate()),
[CO_USUA_MODI] [dbo].[TD_VC_008_USUA] NULL CONSTRAINT [DF__TDTBLS_SI__CO_US__3A81B327] DEFAULT (substring(suser_sname(),(1),(8))),
[FE_USUA_MODI] [dbo].[TD_DT_001_SIST] NULL CONSTRAINT [DF__TDTBLS_SI__FE_US__3B75D760] DEFAULT (getdate())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDTBLS_SIST] WITH NOCHECK ADD CONSTRAINT [CK__TDTBLS_SI__ST_PK__37A5467C] CHECK NOT FOR REPLICATION (([ST_PKEY]='N' OR [ST_PKEY]='S'))
GO
ALTER TABLE [dbo].[TDTBLS_SIST] ADD CONSTRAINT [PK__TDTBLS_S__83A4E806695C9DA1] PRIMARY KEY CLUSTERED  ([CO_SIST], [CO_TBLS], [CO_ATRI]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[TDTBLS_SIST] ADD CONSTRAINT [FK__TDTBLS_SIST__2724C5F0] FOREIGN KEY ([CO_SIST], [CO_TBLS]) REFERENCES [dbo].[TMTBLS_SIST] ([CO_SIST], [CO_TBLS])
GO
GRANT SELECT ON  [dbo].[TDTBLS_SIST] TO [public]
GRANT INSERT ON  [dbo].[TDTBLS_SIST] TO [public]
GRANT DELETE ON  [dbo].[TDTBLS_SIST] TO [public]
GRANT UPDATE ON  [dbo].[TDTBLS_SIST] TO [public]
GO
